//views文件夹下的vue组件
import Vue from 'vue'
import VueRouter from 'vue-router'
import login from "@/views/login.vue";
import TicketInfoList from "@/views/TicketInfoList.vue";
import TravelListPage from "@/views/TravelListPage.vue";
import EmpInfoList from "@/views/EmpInfoList.vue";
import Admin from "@/views/Admin.vue";
import Employee from "@/views/Employee.vue";
import Transportationlist from "@/views/Transportationlist.vue";
import AddTravelInfo from "@/views/AddTravelInfo.vue";
import Login from "@/views/login.vue";

Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		component: Login,
	},
	{
		path: '/login',
		name: 'login',
		component: login
	},
	{
		path: '/employee',
		name: 'employee',
		component: Employee,
		// redirect: '/emplist',
		children: [
			{path: '/ticketInfoList', component: TicketInfoList},
			{path: '/travelListPage', component: TravelListPage}
		]
	},
	{
		path: '/admin',
		name: 'admin',
		component: Admin,
		// redirect: '/emplist',
		children: [
			{path: '/empInfoList', component: EmpInfoList},
			{path: '/transportationlist', component: Transportationlist}
		]
	},
	{
		path: '/addTravelInfo',
		name: 'addTravelInfo',
		component: AddTravelInfo
	},
]

// router管理route
const router = new VueRouter({
	routes
})

export default router
